(global.webpackJsonp = global.webpackJsonp || []).push([ [ "wjyk_recycle/pages/order-now/order-now" ], {
    "4c67": function(t, e, n) {
        (function(t) {
            function e(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            n("8163"), e(n("66fd")), t(e(n("7bec")).default);
        }).call(this, n("543d").createPage);
    },
    "7bec": function(t, e, n) {
        n.r(e);
        var i, a = n("869e"), s = n("f0d6");
        for (i in s) "default" !== i && function(t) {
            n.d(e, t, function() {
                return s[t];
            });
        }(i);
        n("ea39");
        var r = n("f0c5"), a = Object(r.a)(s.default, a.b, a.c, !1, null, null, null, !1, a.a, void 0);
        e.default = a.exports;
    },
    "869e": function(t, e, n) {
        function i() {
            this.$createElement, this._self._c;
        }
        var a = {
            sunuiUpimg: function() {
                return n.e("components/sunui-upimg/sunui-upimg").then(n.bind(null, "b21b"));
            },
            sunuiPopup: function() {
                return n.e("components/sunui-popup/sunui-popup").then(n.bind(null, "c2fe"));
            },
            richParser: function() {
                return Promise.all([ n.e("common/vendor"), n.e("components/rich-parser/rich-parser") ]).then(n.bind(null, "02a9"));
            }
        }, s = [];
        n.d(e, "b", function() {
            return i;
        }), n.d(e, "c", function() {
            return s;
        }), n.d(e, "a", function() {
            return a;
        });
    },
    abda: function(t, i, a) {
        (function(s) {
            Object.defineProperty(i, "__esModule", {
                value: !0
            }), i.default = void 0;
            var r = t(a("4795")), n = t(a("5438"));
            function t(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            function u(t, e, n, i, a, s, r) {
                try {
                    var o = t[s](r), u = o.value;
                } catch (t) {
                    return n(t), 0;
                }
                o.done ? e(u) : Promise.resolve(u).then(i, a);
            }
            function o(o) {
                return function() {
                    var t = this, r = arguments;
                    return new Promise(function(e, n) {
                        var i = o.apply(t, r);
                        function a(t) {
                            u(i, e, n, a, s, "next", t);
                        }
                        function s(t) {
                            u(i, e, n, a, s, "throw", t);
                        }
                        a(void 0);
                    });
                };
            }
            var e = {
                data: function() {
                    return {
                        pic_url: this.$imgUrl,
                        tempId: "",
                        obj: {
                            pic_url: ""
                        },
                        currentIndex: 2,
                        flag: 0,
                        regularFlag: 0,
                        quicklyFlag: 1,
                        cateList: [],
                        addressflag: !1,
                        addressInfo: {},
                        addressid: "",
                        multiArray: [],
                        multiIndex: [ 0, 0, 0 ],
                        typeList: [],
                        dateList: [],
                        xxList: [],
                        dateIndex: [ 0, 0 ],
                        dateVal: "",
                        firstVal: "",
                        firstId: "",
                        secondVal: "",
                        secondId: "",
                        number: "",
                        unit: "",
                        interval: "",
                        partnerid: "",
                        tip_left: "",
                        tip_phone: "",
                        tip_right: "",
                        input_index: null,
                        user_protocol_name: "",
                        user_protocol: "",
                        isProtocol: !0,
                        regular_open: ""
                    };
                },
                onShow: function() {
                    n.default.releaseKey("submit");
                    this.systems(), this.reserveTimeList();
                },
                onLoad: function() {
                    this.systems(), this.reserveTimeList();
                },
                methods: {
                    xOpen: function() {
                        this.$refs.pop.show({
                            style: "background-color:#fff;width:600rpx;height:800rpx;border-radius:10rpx;",
                            xclose: !0
                        });
                    },
                    xCheck: function() {
                        this.isProtocol = !this.isProtocol;
                    },
                    handleAddReceipt: function() {
                        s.showModal({
                            title: "提示",
                            content: "请先去添加地址",
                            showCancel: !1
                        }), console.log("aaaa");
                    },
                    changeIndex: function(t) {
                        console.log("index", t), 2 == t && (this.quicklyFlag = 1), this.currentIndex = t;
                    },
                    bindDatePickerChange: function(t) {
                        console.log("e", t, this.dateList[0][t.detail.value[0]].name, this.dateList[1][t.detail.value[1]].name), 
                        this.dateVal = this.dateList[0][t.detail.value[0]].name + " " + this.dateList[1][t.detail.value[1]].name;
                    },
                    bindDatePickerColumnChange: function(t) {
                        console.log("eee", t, this.dateList), 0 == t.detail.column && (this.dateIndex[0] = t.detail.value, 
                        this.dateIndex[1] = 0, console.log("aaaaaaaaaaaaaaa", this.dateIndex), this.setRange2()), 
                        1 == t.detail.column && (this.dateIndex[1] = t.detail.value, console.log("bbbbbbbbbbbbb", this.dateIndex), 
                        this.setRange2());
                    },
                    bindMultiPickerChange: function(t) {
                        var e = 0;
                        console.log("==============", t, t.detail), console.log("第一个值", this.multiArray[0][t.detail.value[0]].name, this.multiArray[0][t.detail.value[0]].id), 
                        console.log("第二个值", this.multiArray[1][t.detail.value[1]], this.multiArray[1][t.detail.value[1]].name, this.multiArray[1][t.detail.value[1]].id), 
                        this.firstVal = this.multiArray[0][t.detail.value[0]].name, this.firsId = this.multiArray[0][t.detail.value[0]].id, 
                        this.secondVal = this.multiArray[1][t.detail.value[1]].name, this.secondId = this.multiArray[1][t.detail.value[1]].id, 
                        this.unit = this.multiArray[1][t.detail.value[1]].unit;
                        for (var n = 0; n < this.cateList.length; n++) this.cateList[n].firsId == this.firsId && this.cateList[n].secondId == this.secondId && (this.cateList[n].number = this.cateList[n].number + 1, 
                        e = 1);
                        0 == e && this.cateList.push({
                            firsId: this.firsId,
                            firstVal: this.firstVal,
                            secondId: this.secondId,
                            secondVal: this.secondVal,
                            number: 1,
                            unit: this.unit
                        }), console.log("------------", this.cateList);
                    },
                    bindMultiPickerColumnChange: function(t) {
                        console.log("修改的列为", t, t.detail.column, "，值为", t.detail.value), 0 == t.detail.column && (this.multiIndex[0] = t.detail.value, 
                        this.multiIndex[1] = 0, this.multiIndex[2] = 0, console.log("aaaaaaaaaaaaaaa", this.multiIndex), 
                        this.setRange()), 1 == t.detail.column && (this.multiIndex[1] = t.detail.value, 
                        this.multiIndex[2] = t.detail.value, console.log("bbbbbbbbbbbbb", this.multiIndex), 
                        this.setRange());
                    },
                    selectAddress: function() {
                        s.setStorageSync("addressName", "order"), s.navigateTo({
                            url: "/wjyk_recycle/pages/address/address"
                        });
                    },
                    setRange: function() {
                        var e = [ [], [], [] ];
                        this.typeList.forEach(function(t) {
                            console.log("000", t, e), e[0].push({
                                id: t.id,
                                name: t.name
                            });
                        }), this.typeList[this.multiIndex[0]].children.forEach(function(t) {
                            e[1].push({
                                id: t.id,
                                name: t.name,
                                unit: t.unit
                            });
                        }), this.typeList[this.multiIndex[0]].children[this.multiIndex[1]].children.forEach(function(t) {
                            e[2].push({
                                name: t.reference
                            });
                        }), this.multiArray = e, this.$forceUpdate();
                    },
                    setRange2: function() {
                        var e = [ [], [] ];
                        console.log("----------", this.xxList), this.xxList.forEach(function(t) {
                            e[0].push({
                                name: t.name
                            });
                        }), console.log("this.date+++", this.dateIndex[0], this.xxList[this.dateIndex[0]], this.xxList[this.dateIndex[0]].children), 
                        this.xxList[this.dateIndex[0]].children.forEach(function(t) {
                            console.log("el", t), e[1].push({
                                name: t
                            });
                        }), this.dateList = e, this.$forceUpdate();
                    },
                    getImageInfo: function(t) {
                        console.log(t), this.obj.pic_url = "";
                        for (var e = 0; e < t.length; e++) {
                            if (e == t.length - 1) return void (this.obj.pic_url += t[e]);
                            this.obj.pic_url += t[e] + ",";
                        }
                    },
                    reserve: function() {
                        var t, i = this, e = !0, a = 0 == this.flag ? 2 : 1;
                        return console.log("立即预约", this.flag, this.regularFlag, a), console.log("this.obj.pic_url", this.obj.pic_url), 
                        console.log("分类内容", this.cateList), this.addressid ? 1 == this.currentIndex && 0 == this.cateList.length ? (this.$sun.toast("请添加回收物品"), 
                        void (e = !1)) : this.dateVal ? 0 == this.flag && 0 == this.regularFlag && 1 == this.currentIndex ? (this.$sun.toast("请选择回收类型"), 
                        void (e = !1)) : 1 != this.regularFlag || this.interval || 1 != this.currentIndex ? this.isProtocol ? (this.$sun.toast("请勾选下单协议"), 
                        void (e = !1)) : void (e && n.default.uniDoFunc({
                            key: "submit",
                            success: (t = o(r.default.mark(function t() {
                                var e, n;
                                return r.default.wrap(function(t) {
                                    for (;;) switch (t.prev = t.next) {
                                      case 0:
                                        return t.next = 2, i.$http({
                                            url: i.$api.reserveAddOrder,
                                            data: {
                                                uid: s.getStorageSync("uid"),
                                                addressid: i.addressid,
                                                partnerid: i.partnerid,
                                                content: i.cateList,
                                                reservetime: i.dateVal,
                                                type: 1 == i.currentIndex ? a : i.quicklyFlag,
                                                interval: i.interval,
                                                pic_url: i.obj.pic_url
                                            }
                                        });

                                      case 2:
                                        0 == (e = t.sent).errno ? (n = e.data, null == i.tempId || "" == i.tempId ? s.reLaunch({
                                            url: "../appointment-successful/appointment-successful?orderid=" + n
                                        }) : i.acceptMessage(n)) : i.$sun.toast(e.message), console.log("防抖... 在事件触发前连续点击事件会重新计时");

                                      case 5:
                                      case "end":
                                        return t.stop();
                                    }
                                }, t);
                            })), function() {
                                return t.apply(this, arguments);
                            })
                        })) : (this.$sun.toast("请输入回收间隔"), void (e = !1)) : (this.$sun.toast("请选择预约时间"), 
                        void (e = !1)) : (this.$sun.toast("请选择地址"), void (e = !1));
                    },
                    acceptMessage: function(i) {
                        var e, a = this;
                        console.log("订阅消息", i), wx.getSetting({
                            withSubscriptions: !0,
                            success: (e = o(r.default.mark(function t(e) {
                                var n;
                                return r.default.wrap(function(t) {
                                    for (;;) switch (t.prev = t.next) {
                                      case 0:
                                        if (console.log("=================", e, e.subscriptionsSetting), 0 == e.subscriptionsSetting.mainSwitch) return t.next = 4, 
                                        a.$http({
                                            url: a.$api.sendSubMessage,
                                            data: {
                                                openid: s.getStorageSync("openid"),
                                                orderid: i
                                            }
                                        });
                                        t.next = 8;
                                        break;

                                      case 4:
                                        0 == (n = t.sent).errno ? (console.log("订阅消息", n), s.reLaunch({
                                            url: "../appointment-successful/appointment-successful?orderid=" + i
                                        })) : a.$sun.toast(n.message), t.next = 9;
                                        break;

                                      case 8:
                                        s.requestSubscribeMessage({
                                            tmplIds: [ a.tempId ],
                                            success: function() {
                                                var e = o(r.default.mark(function t(e) {
                                                    var n;
                                                    return r.default.wrap(function(t) {
                                                        for (;;) switch (t.prev = t.next) {
                                                          case 0:
                                                            if (console.log("data", e), "accept" == e[a.tempId]) return console.log("授权成功", e), 
                                                            t.next = 5, a.$http({
                                                                url: a.$api.sendSubMessage,
                                                                data: {
                                                                    openid: s.getStorageSync("openid"),
                                                                    orderid: i
                                                                }
                                                            });
                                                            t.next = 9;
                                                            break;

                                                          case 5:
                                                            0 == (n = t.sent).errno ? (console.log("订阅消息", n), s.reLaunch({
                                                                url: "../appointment-successful/appointment-successful?orderid=" + i
                                                            })) : a.$sun.toast(n.message), t.next = 10;
                                                            break;

                                                          case 9:
                                                            wx.showModal({
                                                                title: "温馨提示",
                                                                content: "您已拒绝授权，将无法在微信中收到报名通知！",
                                                                showCancel: !1,
                                                                success: function(t) {
                                                                    t.confirm && s.reLaunch({
                                                                        url: "../appointment-successful/appointment-successful?orderid=" + i
                                                                    });
                                                                }
                                                            });

                                                          case 10:
                                                          case "end":
                                                            return t.stop();
                                                        }
                                                    }, t);
                                                }));
                                                return function(t) {
                                                    return e.apply(this, arguments);
                                                };
                                            }()
                                        });

                                      case 9:
                                      case "end":
                                        return t.stop();
                                    }
                                }, t);
                            })), function(t) {
                                return e.apply(this, arguments);
                            }),
                            fail: function(t) {
                                console.log("失败", t);
                            },
                            complete: function(t) {
                                console.log("完成", t);
                            }
                        });
                    },
                    systems: function() {
                        var n = this;
                        return o(r.default.mark(function t() {
                            var e;
                            return r.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.system
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (console.log("系统设置", e), n.tip_left = e.data.report[0], 
                                    n.tip_right = e.data.report[2], n.tip_phone = e.data.report_phone, n.tempId = e.data.receiveTemplate, 
                                    n.user_protocol_name = e.data.user_protocol_name, n.user_protocol = e.data.user_protocol, 
                                    n.regular_open = e.data.regular_open, n.getDefault());

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    changeFlag: function(t, e) {
                        console.log("回收类型", t, e), "single" == e ? (this.flag = t, this.regularFlag = 0) : (this.regularFlag = t, 
                        this.flag = 0);
                    },
                    changeNumber: function(t) {
                        var e = t.detail.value;
                        this.xx(Number(e), this.input_index), console.log("输入的值", t, e), console.log("this.this.cateList", this.cateList);
                    },
                    getUnit: function(t) {
                        this.input_index = t;
                    },
                    xx: function(t, e) {
                        this.cateList[e].number = Number(t), console.log("-----------", this.cateList);
                    },
                    reduce: function(t, e) {
                        1 < t && (this.cateList[e].number = t - 1), console.log("点击减号", t, this.cateList[e], this.cateList);
                    },
                    add: function(t, e) {
                        this.cateList[e].number = t + 1, console.log("点击加号", t, this.cateList[e], this.cateList);
                    },
                    deleteList: function(t) {
                        this.cateList.splice(t, 1), console.log("点击了删除", this.cateList);
                    },
                    reserveCateList: function() {
                        var n = this;
                        return o(r.default.mark(function t() {
                            var e;
                            return r.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.reserveCateList,
                                        data: {
                                            partnerid: n.partnerid
                                        }
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.typeList = e.data, console.log("回收类型列表", e), n.setRange());

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    reserveTimeList: function() {
                        var n = this;
                        return o(r.default.mark(function t() {
                            var e;
                            return r.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.reserveTimeList
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.xxList = e.data, console.log("选择时间列表", e.data, e), 
                                    n.setRange2());

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getDefault: function() {
                        var n = this;
                        return o(r.default.mark(function t() {
                            var e;
                            return r.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.getDefault,
                                        data: {
                                            uid: s.getStorageSync("uid")
                                        }
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (0 == e.data.length ? (console.log("111111111111111111"), 
                                    n.addressflag = !0) :n.addressflag = !1, 
                                    n.addressInfo = e.data, n.addressid = e.data.id, n.partnerid = e.data.flag, n.reserveCateList(), 
                                    console.log("22222222222222222", n.partnerid)), console.log("获得默认地址", e, n.addressflag);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    callPhone: function() {
                        this.$sun.phone(this.tip_phone);
                    }
                }
            };
            i.default = e;
        }).call(this, a("543d").default);
    },
    b4ca: function(t, e, n) {},
    ea39: function(t, e, n) {
        var i = n("b4ca");
        n.n(i).a;
    },
    f0d6: function(t, e, n) {
        n.r(e);
        var i, a = n("abda"), s = n.n(a);
        for (i in a) "default" !== i && function(t) {
            n.d(e, t, function() {
                return a[t];
            });
        }(i);
        e.default = s.a;
    }
}, [ [ "4c67", "common/runtime", "common/vendor" ] ] ]);